package com.wolfstreet.wsonline.util;

import com.wolfstreet.wsonline.WSOApplication;

import android.widget.Toast;

/**
 * toast工具类
 * 
 * @author sy
 * 
 */
public class ToastUtil {

	public static void showShotToast(String msg) {
		if (WSOApplication.getInstance().myToast != null) {
			WSOApplication.getInstance().myToast
					.setDuration(Toast.LENGTH_SHORT);
			WSOApplication.getInstance().myToast.setText(msg);
			WSOApplication.getInstance().myToast.show();
		}
	}

	public static void showLongToast(String msg) {
		if (WSOApplication.getInstance().myToast != null) {
			WSOApplication.getInstance().myToast
					.setDuration(Toast.LENGTH_LONG);
			WSOApplication.getInstance().myToast.setText(msg);
			WSOApplication.getInstance().myToast.show();
		}
	}

	public static void showShotToast(int msg_id) {
		if (WSOApplication.getInstance().myToast != null) {
			WSOApplication.getInstance().myToast
					.setDuration(Toast.LENGTH_LONG);
			WSOApplication.getInstance().myToast.setText(msg_id);
			WSOApplication.getInstance().myToast.show();
		}
	}

	public static void showLongToast(int msg_id) {
		if (WSOApplication.getInstance().myToast != null) {
			WSOApplication.getInstance().myToast
					.setDuration(Toast.LENGTH_LONG);
			WSOApplication.getInstance().myToast.setText(msg_id);
			WSOApplication.getInstance().myToast.show();
		}
	}
}
